﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Data.Linq;
using System.Data.Linq.Mapping;
using Microsoft.Phone.Data.Linq;
using Microsoft.Phone.Data.Linq.Mapping;
using System.ComponentModel;

 public class dbContext : DataContext
    {
        public dbContext(string constring) : base(constring) { }
        public Table<GlucoseHist> GlucoseHist;
        public Table<tblEmpJob> tblEmpjobs;
    }
[Table]
public class GlucoseHist
{
	public GlucoseHist(){}
    public GlucoseHist( string GHID, string PersonID, string DeviceID, float GlucoseValue, string DateTime, string GHNotes, string WhereMeasured)
    {
        GlucoseHistID=GHID;
        PID=PersonID;
        DID=DeviceID;
        GValue=GlucoseValue;
        DT=DateTime;
        GlucoseHistNotes=GHNotes;
        WM=WhereMeasure;
    }
    string GlucoseHist;
    string PID;
    string DID;
    float GValue;
    string DT;
    string GlucoseHistNotes;
    string WM;
     [ Column (IsPrimaryKey = true, IsDbGenerated = true, DbType= "INT NOT NULL Identity", CanbeNull=false, AutoSync = AutoSync.OnInsert)]
    public string GlucoseHist
     {
         get { return _GlucoseHist;}
         set {_GlucoseHist = value;}
     }
    [Column]
    public string PID
    {
        get {return _PID;}
        set {_PID = value;}
    }
    [Column]
    public string DID
    {
        get {return _DID;}
        set {_DID = value;}
    }
    [Column]
    public float GValue
    {
        get { return _GValue;}
        set {_GValue = value;}
    }
    [Column]
    public string DT
    {
        get { return _DT;}
        set {_DT = value;}
    }
    [Column]
    public string GlucoseHistNotes
    {
        get { return _GlucoseHistNotes;}
        set {_GlucoseHistNotes = value;}
    }
    [Column]
    public string WM
    {
        get { return _WM;}
        set {_WM = value;}
    }
}




[Table]
public class GlucoseGoal
{
    public GlucoseGoal(){}
    public GlucoseGoal(string GluGoalID, string PersonID, float GLowValue, float GHighValue, float GluGValue)
    {
        GGID= GluGoalID;
        PID=PersonID;
        GLV=GLowValue;
        GHV=GHighValue;
        GGV=GluGValue;
    }
    string _GGID;
    string _PID;
    float _GLV;
    float _GHV;
    float _GGV;
    [Column(IsPrimaryKey = ture, IsDbgenerated = true, Dbtype= "INT NOT NULL Identity", CanBeNull = false, AutoSync= AutoSync.OnInsert)]
    public string GGID
    {
        get { return _GGID;}
        set {_GGID = value;}
    }
    [Column]
    public string PID
    {
        get { return _PID;}
        set {_PID = value;}
    }
    [Column]
    public float GLV
    {
        get { return _GLV;}
        set {_GLV = value;}
    }
    [Column]
    public float GHV
    {
        get { return _GHV;}
        set {_GHV = value;}
    }
    [Column]
    public float GGV
    {
        get { return _GGV;}
        set {_GGV = value;}
    }

}
